Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for semicolon stripping to DbApiHook, PrestoHook, and TrinoHook #41916

Merged
merged 18 commits into from
Nov 13, 2024

Conversation

Illumaria
Copy link
Contributor

@Illumaria Illumaria commented Aug 31, 2024

Closes: #34828

Copy link

boring-cyborg bot commented Aug 31, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk
Copy link
Member

potiuk commented Sep 1, 2024

You will have to:

  1. bump common.sql minor version (new feature) in airfow/providers/common/sql/provider.yaml
  2. In all modified providers you will have to update dependency in provider yaml to be: common-sql >= THE(_NEW_COMMON_SQL_VERSION

@Illumaria
Copy link
Contributor Author

Whoops... Sorry. 🙏🏻

airflow/providers/common/sql/provider.yaml Outdated Show resolved Hide resolved
airflow/providers/presto/provider.yaml Outdated Show resolved Hide resolved
@eladkal
Copy link
Contributor

eladkal commented Sep 6, 2024

@Illumaria can you address the needed changes? I'm hoping to include this PR in the next release

@eladkal
Copy link
Contributor

eladkal commented Sep 6, 2024

needs rebase and resolve conflicts

@Illumaria
Copy link
Contributor Author

@eladkal Sure, I’ll do it by the end of the weekend.

@potiuk
Copy link
Member

potiuk commented Nov 12, 2024

Rebased after merging #43913

@eladkal
Copy link
Contributor

eladkal commented Nov 12, 2024

OK @Illumaria I think we sort out all the issues related to breeze testing. We now see failures which seems related to the PR itself for the back compat tests with Airflow 2.8 can you take a look?

=========================== short test summary info ============================
FAILED providers/tests/google/cloud/openlineage/test_mixins.py::TestBigQueryOpenLineageMixin::test_bq_job_information - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
FAILED providers/tests/google/cloud/openlineage/test_mixins.py::TestBigQueryOpenLineageMixin::test_bq_script_job_information - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
FAILED providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryInsertJobOperator::test_execute_openlineage_events - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
FAILED providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryInsertJobOperator::test_execute_fails_openlineage_events - TypeError: split() got an unexpected keyword argument 'strip_semicolon'
====== 4 failed, 4199 passed, 79 skipped, 1 warning in 261.82s (0:04:21) =======

The above test failures are due to using sqlparser<0.5 so our lower dependency tests have successfully found that we need to bump sqlparser to use the strip_semicolon parameter.

@Illumaria
Copy link
Contributor Author

Illumaria commented Nov 13, 2024

Uhm... Is this a network issue on GitHub side? O_o
https://github.com/apache/airflow/actions/runs/11816640286/job/32920825020?pr=41916#step:2:13

Run docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
Unable to find image 'bash:latest' locally
docker: Error response from daemon: Head "https://registry-1.docker.io/v2/library/bash/manifests/latest": Get "https://auth.docker.io/token?account=githubactions&scope=repository%3Alibrary%2Fbash%3Apull&service=registry.docker.io": net/http: request canceled (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
Error: Process completed with exit code 125.

@potiuk
Copy link
Member

potiuk commented Nov 13, 2024

Uhm... Is this a network issue on GitHub side? O_o

Yeah.... Happens

@potiuk
Copy link
Member

potiuk commented Nov 13, 2024

We (committers) can re-start that one failed job later after this PR completes all other checks.

@Illumaria
Copy link
Contributor Author

@potiuk Could you please re-run the failed test job? I don't think I have the rights.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE! finally!

@potiuk potiuk merged commit e7194df into apache:main Nov 13, 2024
109 checks passed
Copy link

boring-cyborg bot commented Nov 13, 2024

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@potiuk
Copy link
Member

potiuk commented Nov 13, 2024

Wooooohooo! (CC: @eladkal )

@potiuk
Copy link
Member

potiuk commented Nov 13, 2024

Thanks @Illumaria for the patience. It was not an easy one and it uncovered a number of edge-cases in our CI that we had to fix :)

#protm

@eladkal
Copy link
Contributor

eladkal commented Nov 13, 2024

Great work @Illumaria 👏🏻👏🏻

ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
…noHook (apache#41916)



---------

Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers full tests needed We need to run full set of tests for this PR to merge provider:common-sql provider:presto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trino SQL split trailing semi-colon
5 participants